<script type="text/javascript">
	$(document).ready(function(){ 
		$("#overall_err").hide();
		$("#login").click(function(){
		
			$.post('ajax/registration/login.php', { uname: $('#uname').val(), pword: $('#pword').val() }, function(data){
														if(data=="ok"){
															$("#overall_err").slideUp();
															   $("#loginout").html('<a id="no_highlight" href="#logout">	 <div id="nav_logout"></div>	</a>')
															   $("#loginout").bind('click', function(){
																	$.get('ajax/registration/logout.php', function(data){
																		//alert(data);
																		$("#loginout").html('<a id="no_highlight" href="#login">	 <div id="nav_login"></div>	</a>')
																		$("#loginout").bind('click', function(){
																			fetchPage('login')
																		});
																	});
	
																});
															fetchPage('forum');
														} else {
															$("#overall_err").slideDown();
															$("#innertext").html(data);
														}
													})
		
		});
		
		reassert("#reg-link");
	});
</script>
<h2>Login</h2>
<p>
		<div id="overall_err">
            <div class="ui-widget"> 
                <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
                    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
                    <strong>Error:</strong><span id="innertext"></span></p> 
                </div> 
            </div> 
         </div>

<table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><strong>Username:</strong></td>
    <td><input id="uname" type="text"></td>
  </tr>
  <tr>
    <td><strong>Password:</strong></td>
    <td><input id="pword" type="password"></td>
  </tr>
  <tr>
    <td id="no_border">&nbsp;</td>
    <td id="no_border"><input id="login" type="button" value="take me home!"></td>
  </tr>
</table>
</p>
<h2>Register</h2>
<p>Not signed up? Then lets <a id="reg-link" href="#reg">register</a>!</p>
